//
//  AppUtil.m
//  trading
//
//  Created by 张玲 on 15/8/29.
//  Copyright (c) 2015年 getco. All rights reserved.
//

#import "AppUtil.h"
#import "MBProgressHUD.h"
@implementation AppUtil

+(void) showProgressDialog:(MBProgressHUD *)hud withContent:(NSString *)content{
    hud.mode=MBProgressHUDModeIndeterminate;
    hud.labelText=content;
    [hud show:YES];
}

+(void) showToast:(UIView *)view withContent:(NSString *)content{
    MBProgressHUD* hud=[MBProgressHUD showHUDAddedTo:view animated:YES];
    //[view addSubview:hud];
    hud.mode=MBProgressHUDModeText;
    hud.labelText=content;
    hud.margin=10.f;
    hud.yOffset=150.f;
    hud.removeFromSuperViewOnHide=YES;
    [hud hide:YES afterDelay:2];
}

+(BOOL) isBlank:(NSString *)str{
    if([str isKindOfClass:[NSNull class]])
        return YES;
    if(str==nil)
      return YES;
    NSString* s=[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    if([s length]==0||[s isEqualToString:@""]|| s==nil){
        return  YES;
    }
    return NO;
}
@end
